using UnityEngine;
using System.Collections;

public class IntroEyes : MonoBehaviour {

	private TextMesh thisText;
	
	private float min;
	private float max;
	
	private float firstX;
	private float firstY;
	void Start()
	{
		thisText = gameObject.GetComponent<TextMesh>();
		min = transform.localScale.y/2;
		max = transform.localScale.y;
		firstX = transform.localPosition.x;
		firstY = transform.localPosition.y;
		StartCoroutine(flash());
	}
	
	IEnumerator flash()
	{
		transform.localScale = new Vector3(transform.localScale.x,max,transform.localScale.z);
		yield return new WaitForSeconds(1f);
		transform.localScale = new Vector3(transform.localScale.x,min,transform.localScale.z);
		yield return new WaitForSeconds(0.05f);
        transform.localScale = new Vector3(transform.localScale.x, max, transform.localScale.z);
        yield return new WaitForSeconds(0.05f);
        transform.localScale = new Vector3(transform.localScale.x, min, transform.localScale.z);
        yield return new WaitForSeconds(0.05f);
        transform.localScale = new Vector3(transform.localScale.x, max, transform.localScale.z);
		StartCoroutine(flash());
	}
	
	void OnResume()
	{		
		StartCoroutine(flash());
	}
}
